package cn.com.pajx.pajx_smart_platform.exception;

import android.annotation.SuppressLint;
import android.os.Environment;

import java.io.File;

/**
 * Created by ruancw on 2024/9/9.
 * APP崩溃日志处理
 */

public class CrashHandler extends CrashException {

    @SuppressLint("StaticFieldLeak")
    public static CrashHandler mCrashAppHandler = null;

    private CrashHandler() {
    }

    public static CrashHandler getInstance() {

        if (mCrashAppHandler == null)
            mCrashAppHandler = new CrashHandler();
        return mCrashAppHandler;

    }

    @Override
    public void initParams(CrashException crashAppLog) {
        if (crashAppLog != null) {
            crashAppLog.setCrashLog(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "crashLog");
            crashAppLog.setLogLimitCount(10);
        }
    }

    @Override
    public void sendCrashLogToServer(File folder, File file, String log) {

    }
}
